package com.example.demo_mysql_mybatisplus.util.controller.advicer.core;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;

/**
 * rest响应DTO
 * 不对外开放，只在本包内使用
 */
@Getter
public class RestResponse {

    /** 状态码 */
    private Integer code;
    /** 描述说明 */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private String desc;
    /** 正常响应结果*/
    private Object data;
    /** 异常信息 */
    private Object error;

    RestResponse(Integer code, String desc, Object data, Object error) {
        this.code = code;
        this.desc = desc;
        this.data = data;
        this.error = error;
    }

}